Skip to content

[๐Ÿš€ ์‚ฌ์ดํด2 - ๋ฏธ์…˜ (๋ธ”๋ž™์žญ ๊ฒŒ์ž„ ์‹คํ–‰)] ์—๋ด ๋ฏธ์…˜ ์ œ์ถœํ•ฉ๋‹ˆ๋‹ค.#1111

Open
RealTake wants to merge 52 commits intowoowacourse:realtakefrom
RealTake:step2

Conversation

@RealTake
Copy link

์•ˆ๋…•ํ•˜์„ธ์š”, ๊ธฐ๋ก !

์ฃผ์‹  ํ”ผ๋“œ๋ฐฑ์„ ์—ฌ๋Ÿฌ ๋ฒˆ ๊ณฑ์”น์–ด ๋ณด๋ฉด์„œ ๋‹ค์–‘ํ•œ ๋ฐฉ์‹๋„ ์‹œ๋„ํ•ด ๋ณด๋А๋ผ PR๊ณผ ๋‹ต์žฅ์„ ๋Šฆ๊ฒŒ ์˜ฌ๋ฆฌ๊ฒŒ ๋˜์–ด ์ฃ„์†กํ•ฉ๋‹ˆ๋‹คใ…œใ…œ

ํ”ผ๋“œ๋ฐฑ์„ ๋ฐ”ํƒ•์œผ๋กœ ๋‹ค๋ฅธ ํฌ๋ฃจ๋ถ„๋“ค๊ณผ๋„ ์˜๊ฒฌ์„ ๋‚˜๋ˆ„๊ณ , ์—ฌ๋Ÿฌ ํฌ๋ฃจ๋“ค์˜ ์ฝ”๋“œ๋ฅผ ์‚ดํŽด๋ณด๋ฉด์„œ ์ œ๊ฐ€ ๋ฏธ์ฒ˜ ์ƒ๊ฐํ•˜์ง€ ๋ชปํ–ˆ๋˜ ๋ฐฉ์‹์ด๋‚˜ ํ‚ค์›Œ๋“œ๋“ค์„ ๋งŽ์ด ์•Œ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋•๋ถ„์— ๋งŽ์€ ๊ฒƒ์„ ๋ฐฐ์šฐ๋Š” ์‹œ๊ฐ„์ด ๋˜์—ˆ๊ณ , ๊ทธ๋Ÿฌ๋‹ค ๋ณด๋‹ˆ ์ผ์ฃผ์ผ์ด ์ •๋ง ๋น ๋ฅด๊ฒŒ ์ง€๋‚˜๊ฐ„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

ํŠนํžˆ ์˜ค๋žœ๊ธฐ๊ฐ„ ๊ฐœ๋ฐœ์„ ํ•ด์˜ค๋ฉด์„œ ์ฃผ์„ ๋˜ํ•œ ๊ด€๋ฆฌ์˜ ๋Œ€์ƒ์ด ๋  ์ˆ˜ ์žˆ๋‹ค๋Š” ์ ์€ ์ƒ๊ฐํ•˜์ง€ ๋ชปํ–ˆ๋˜ ๋ถ€๋ถ„์ด๋ผ ์•„์ง๋„ ๋ต..ํ•ฉ๋‹ˆ๋‹ค..!

PR์— ์•ž์„œ ๋‹ค์‹œ ์ข‹์€ ํ”ผ๋“œ๋ฐฑ ์ฃผ์…”์„œ ๋‹ค์‹œ ํ•œ ๋ฒˆ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค..!

์ฒดํฌ ๋ฆฌ์ŠคํŠธ

  • ๋ฏธ์…˜์˜ ํ•„์ˆ˜ ์š”๊ตฌ์‚ฌํ•ญ์„ ๋ชจ๋‘ ๊ตฌํ˜„ํ–ˆ๋‚˜์š”?
  • Gradle test๋ฅผ ์‹คํ–‰ํ–ˆ์„ ๋•Œ, ๋ชจ๋“  ํ…Œ์ŠคํŠธ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ํ†ต๊ณผํ–ˆ๋‚˜์š”?
  • ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰๋˜๋‚˜์š”?

์–ด๋–ค ๋ถ€๋ถ„์— ์ง‘์ค‘ํ•˜์—ฌ ๋ฆฌ๋ทฐํ•ด์•ผ ํ• ๊นŒ์š”?

  1. ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜(Players)๊ณผ ์ˆ˜์ต ๊ณ„์‚ฐ ์œ„์น˜

์ƒํ™ฉ
์‚ฌ์ดํด 2์—์„œ ๋ฐฐํŒ… ๊ธฐ๋Šฅ์ด ์ถ”๊ฐ€๋˜๋ฉด์„œ ๊ฐ ์ฐธ๊ฐ€์ž์˜ ์ˆ˜์ต์„ ๊ณ„์‚ฐํ•ด์•ผ ํ•˜๋Š” ์š”๊ตฌ์‚ฌํ•ญ์ด ์ƒ๊ฒผ์Šต๋‹ˆ๋‹ค.
ํ˜„์žฌ๋Š” BlackjackGame์˜ calculateAllPlayerRevenue() ๋ฉ”์„œ๋“œ์—์„œ ์ „์ฒด ํ”Œ๋ ˆ์ด์–ด์˜ ์ˆ˜์ต์„ ๊ณ„์‚ฐํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๊ณผ์ •์—์„œ Players ๋‚ด๋ถ€์˜ ํ”Œ๋ ˆ์ด์–ด๋“ค์„ ์ˆœํšŒํ•ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— Players.getPlayerList() ๋ฉ”์„œ๋“œ๋ฅผ ๋งŒ๋“ค๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๊ณ ๋ฏผ
getPlayerList()๋Š” ๋‚ด๋ถ€ ์ปฌ๋ ‰์…˜์„ ์™ธ๋ถ€๋กœ ๋…ธ์ถœํ•˜๊ฒŒ ๋˜๋ฏ€๋กœ ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜์˜ ์ทจ์ง€์— ๋‹ค์†Œ ์–ด๊ธ‹๋‚˜๋Š” ๊ฒƒ์ด ์•„๋‹Œ์ง€ ๊ณ ๋ฏผ์ด ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๋ž˜์„œ calculateAllPlayerRevenue() ๋ฉ”์„œ๋“œ๋ฅผ Players ๋‚ด๋ถ€๋กœ ์ด๋™์‹œํ‚ค๋Š” ๊ฒƒ๋„ ํ•˜๋‚˜์˜ ๋ฐฉ๋ฒ•์ด๋ผ๊ณ  ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค.
๋งˆ์นจ Player๊ฐ€ betMoney ํ•„๋“œ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์— Players๊ฐ€ ๊ฐ Player๋ฅผ ์ˆœํšŒํ•˜๋ฉฐ ์ˆ˜์ต์„ ๊ณ„์‚ฐํ•˜๋Š” ๊ตฌ์กฐ๋„ ๊ฐ€๋Šฅํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

๋‹ค๋งŒ ์ˆ˜์ต ๊ณ„์‚ฐ์ด๋ผ๋Š” ํ–‰์œ„๊ฐ€ Player๋‚˜ Players๋ณด๋‹ค๋Š” ๊ฒŒ์ž„์˜ ๊ทœ์น™๊ณผ ํ๋ฆ„์„ ๋‹ด๋‹นํ•˜๋Š” BlackjackGame์—์„œ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฒƒ์ด ๋” ์ž์—ฐ์Šค๋Ÿฌ์šด ๊ฒƒ์€ ์•„๋‹์ง€ ๊ณ ๋ฏผ์ด ๋ฉ๋‹ˆ๋‹ค.

๋ฆฌ๋ทฐ ์š”์ฒญ
1. BlackjackGame์ด Players.getPlayerList()๋กœ ์ปฌ๋ ‰์…˜์„ ๊ฐ€์ ธ์™€ ์ˆœํšŒํ•˜๋ฉด์„œ ์ˆ˜์ต์„ ๊ณ„์‚ฐํ•˜๋Š” ๋ฐฉ์‹
2. Players ๋‚ด๋ถ€์— ์ˆ˜์ต ๊ณ„์‚ฐ ๋ฉ”์„œ๋“œ๋ฅผ ๋‘๊ณ  BlackjackGame์—์„œ๋Š” ํ•ด๋‹น ๋ฉ”์„œ๋“œ๋ฅผ ํ˜ธ์ถœ๋งŒ ํ•˜๋Š” ๋ฐฉ์‹

๋‘ ๊ฐ€์ง€ ๊ตฌ์กฐ ์ค‘ ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜์˜ ์˜๋„์™€ ๋„๋ฉ”์ธ ์ฑ…์ž„ ๋ถ„๋ฆฌ ์ธก๋ฉด์—์„œ ์–ด๋–ค ๊ตฌ์กฐ๊ฐ€ ๋” ์ ์ ˆํ• ์ง€ ๊ธฐ๋ก ์˜ ์˜๊ฒฌ์„ ๋“ฃ๊ณ ์‹ถ์Šต๋‹ˆ๋‹ค!


2. Service์™€ Game์˜ ์—ญํ•  ๊ฒฝ๊ณ„

์ƒํ™ฉ

blackjackGame์— ๋Œ€ํ•ด์„œ ์•„๋ž˜ ๊ทœ์น™์„ ์ ์šฉํ•ด๋ณด๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”? getter๋ฅผ ์™œ ์ œ๊ฑฐํ•˜๋ผ๊ณ  ํ•˜๋Š”์ง€๋„ ์ƒ๊ฐํ•ด๋ณด์‹œ์ฃ !
๊ฐ์ฒด์ง€ํ–ฅ ์ƒํ™œ ์ฒด์กฐ ์›์น™
๊ทœ์น™ 9: ๊ฒŒํ„ฐ/์„ธํ„ฐ/ํ”„๋กœํผํ‹ฐ๋ฅผ ์“ฐ์ง€ ์•Š๋Š”๋‹ค.

-> getter๋ฅผ ์ œ๊ฑฐํ•˜๋Š” ๋Œ€์‹  ์„œ๋น„์Šค๊ฐ€ ์™œ ๊ฒŒํ„ฐ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์“ฐ๊ฒŒ ๋๋Š”์ง€๋ฅผ ๋ณด๊ณ , ๊ทธ ์ด์œ ๋ฅผ ๋‹ค์‹œ game์—์„œ ํ•˜๋„๋ก ํ•˜๋‹ค๋ณด๋‹ˆ, ๋Œ€๋ถ€๋ถ„์˜ ์„œ๋น„์Šค ๋กœ์ง๋“ค์ด Game์œผ๋กœ ์ด๋™ํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ง€๊ธˆ์€ Game์ด ๊ฒŒ์ž„ ์ง„ํ–‰ ๋กœ์งโ€์„, Service๊ฐ€ โ€œGame ์ƒ์„ฑ + Game ์œ„์ž„ + DTO ๋ณ€ํ™˜โ€์„ ๋งก๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

blackJackRule์ด ๋น„์ฆˆ๋‹ˆ์Šค ๊ทœ์น™์— ํ•ด๋‹นํ•˜์ง€ ์•Š์„๊นŒ์š”? ๊ทธ๋ ‡๋‹ค๋ณด๋‹ˆ BlackjackGame์ด ๋‹จ์ˆœํžˆ ๊ป๋ฐ๊ธฐ ์—ญํ• ๋กœ๋งŒ ๋ฐ”๋€Œ๋Š”๊ฒƒ ๊ฐ™๋„ค์š”. blackJackGame๋‚ด๋ถ€์—์„œ ์ฒ˜๋ฆฌํ•ด๋ณด๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”?
-> ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ์ƒ์ˆ˜๋งŒ ๋‚จ๊ฒจ๋†“๊ณ  ๊ฐ ํ•„์š”ํ•œ ๋„๋ฉ”์ธ์œผ๋กœ ๋ฉ”์Šค๋“œ๋ฅผ ์ด๋™์‹œ์ผฐ์Šต๋‹ˆ๋‹ค.

ํ˜„์žฌ ์„œ๋น„์Šค ํด๋ž˜์Šค์˜ ์—ญํ• ์€ ๋„๋ฉ”์ธ์„ ์ง์ ‘ ์ปจํŠธ๋กค๋Ÿฌ์— ๋ฐ˜ํ™˜ ํ•˜๊ธฐ ๋ณด๋‹จ DTO๋ฅผ ๋ณ€ํ™˜ํ•ด์„œ ์ฃผ๋Š”๋ฐ ์˜๋ฏธ๋ฅผ ๋‘๊ณ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ณ ๋ฏผ
Service์˜ ์—ญํ• ์ด DTO ๋ณ€ํ™˜๊ณผ blackjackGame.xxx() ํ•œ ๋ฒˆ๋งŒ ํ˜ธ์ถœํ•˜๋Š” ๋‹จ์ˆœ ์œ„์ž„์ด๋ผ, ์ฒ˜์Œ๋ถ€ํ„ฐ ์„œ๋น„์Šค ๋ ˆ์ด์–ด๋ฅผ ๋‘์ง€ ๋ง์•˜์–ด์•ผ ํ–ˆ๋‚˜ ์‹ถ์Šต๋‹ˆ๋‹ค.

๋ฆฌ๋ทฐ ์š”์ฒญ

  • ์ง€๊ธˆ ๊ตฌ์กฐ๋ฅผ ์œ ์ง€ํ•œ ์ฑ„ โ€œService = ์ง„์ž…์  + DTOโ€ ์—ญํ• ๋งŒ ๋ช…์‹œํ• ์ง€
  • Service ๋ ˆ์ด์–ด๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  Controller๊ฐ€ Game์„ ์ง์ ‘ ์“ธ์ง€

๊ธฐ๋ก ์˜ ์˜๊ฒฌ์„ ๋“ฃ๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.!

์‹œ๊ฐ„ ๋‚ด์–ด ๋ฆฌ๋ทฐํ•ด ์ฃผ์…”์„œ ๋‹ค์‹œ ํ•œ ๋ฒˆ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค..!

wonsang.choi added 30 commits March 4, 2026 17:33
- score() ๋ฉ”์†Œ๋“œ ์˜์กด์„ฑ ๋ณ€๊ฒฝ
- controller ๊ธฐ๋Šฅ๋ณ„ ๋ฉ”์†Œ๋“œ ๋ถ„๋ฆฌ
- dto ํŒจํ‚ค์ง€ ๋ณ€๊ฒฝ
wonsang.choi added 21 commits March 10, 2026 13:45
- Deck.cardsํ•„๋“œ๋ฅผ Set์œผ๋กœ ์ „ํ™˜ํ•ด์„œ ์ค‘๋ณต์— ๋Œ€ํ•œ ๋ฌธ์ œ ๋ฐฉ์ง€
- Deck.draw() ์—์„œ finally ๋ฌธ์„ ์‚ฌ์šฉํ•˜๋Š” ๋Œ€์‹  ์ฝ”๋“œ ํ๋ฆ„์œผ๋กœ ๊ฐœ์„ 
fix: hit&Stand ๋กœ์ง ์˜ค๋ฅ˜ ์ˆ˜์ •
- DefaultBlackjackRule: judge๋ฅผ Participant ๊ธฐ๋ฐ˜์œผ๋กœ ๋ณ€๊ฒฝ, BLACKJACK ๊ฒฐ๊ณผ ์ถ”๊ฐ€
- ๊ฐ ํ”Œ๋ ˆ์ด์–ด ๋ณ„ ๋ฐฐํŒ… ๊ธˆ์•ก ์ž…๋ ฅ ๋ฐ›์Œ
Copy link

@Gyuchool Gyuchool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•ˆ๋…•ํ•˜์„ธ์š” ์—๋ด
์‚ฌ์ดํด2 ๋ฏธ์…˜ ์ง„ํ–‰ํ•˜์‹œ๋А๋ผ ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค!! ์ž˜ ๊ตฌํ˜„ํ•ด์ฃผ์…จ๋„ค์š”๐Ÿ‘

๋ช‡ ๊ฐ€์ง€ ์ฝ”๋ฉ˜ํŠธ๋ฅผ ๋‚จ๊ฒจ๋‘์—ˆ์œผ๋‹ˆ ๋ฐ˜์˜ ๋ฐ ์˜๊ฒฌ ์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.๐Ÿ™
๊ถ๊ธˆํ•œ ์ ์€ DM์ด๋‚˜ PR ์ปค๋ฉ˜ํŠธ๋กœ ์–ธ์ œ๋“ ์ง€ ์—ฌ์ญค๋ด์ฃผ์„ธ์š”!

  1. BlackjackGame์ด Players.getPlayerList()๋กœ ์ปฌ๋ ‰์…˜์„ ๊ฐ€์ ธ์™€ ์ˆœํšŒํ•˜๋ฉด์„œ ์ˆ˜์ต์„ ๊ณ„์‚ฐํ•˜๋Š” ๋ฐฉ์‹
  2. Players ๋‚ด๋ถ€์— ์ˆ˜์ต ๊ณ„์‚ฐ ๋ฉ”์„œ๋“œ๋ฅผ ๋‘๊ณ  BlackjackGame์—์„œ๋Š” ํ•ด๋‹น ๋ฉ”์„œ๋“œ๋ฅผ ํ˜ธ์ถœ๋งŒ ํ•˜๋Š” ๋ฐฉ์‹
    ๋‘ ๊ฐ€์ง€ ๊ตฌ์กฐ ์ค‘ ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜์˜ ์˜๋„์™€ ๋„๋ฉ”์ธ ์ฑ…์ž„ ๋ถ„๋ฆฌ ์ธก๋ฉด์—์„œ ์–ด๋–ค ๊ตฌ์กฐ๊ฐ€ ๋” ์ ์ ˆํ• ์ง€ ๊ธฐ๋ก ์˜ ์˜๊ฒฌ์„ ๋“ฃ๊ณ ์‹ถ์Šต๋‹ˆ๋‹ค!

blackJackGame์€ ์นด๋“œ ๊ฒŒ์ž„ ์ง„ํ–‰์„ ๋‹ค๋ฃจ๊ณ  ์žˆ๊ธฐ์— ์ˆ˜์ต ๊ณ„์‚ฐ์— ๋Œ€ํ•œ ์ฑ…์ž„์€ ๋‹ค๋ฅธ ๊ฐ์ฒด์— ๋งก๊ฒจ๋ณด๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”? ๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ•˜๋ฉด์„œ ์–ด๋–ค ๊ฐ์ฒด๊ฐ€ ๋‹ค๋ค„์•ผํ• ์ง€ ํ•จ๊ป˜ ๊ฐœ์„ ํ•ด๊ฐ€๋ณด์‹œ์ฃ ..!

Service์˜ ์—ญํ• ์ด DTO ๋ณ€ํ™˜๊ณผ blackjackGame.xxx() ํ•œ ๋ฒˆ๋งŒ ํ˜ธ์ถœํ•˜๋Š” ๋‹จ์ˆœ ์œ„์ž„์ด๋ผ, ์ฒ˜์Œ๋ถ€ํ„ฐ ์„œ๋น„์Šค ๋ ˆ์ด์–ด๋ฅผ ๋‘์ง€ ๋ง์•˜์–ด์•ผ ํ–ˆ๋‚˜ ์‹ถ์Šต๋‹ˆ๋‹ค.

  • ์ง€๊ธˆ ๊ตฌ์กฐ๋ฅผ ์œ ์ง€ํ•œ ์ฑ„ โ€œService = ์ง„์ž…์  + DTOโ€ ์—ญํ• ๋งŒ ๋ช…์‹œํ• ์ง€
  • Service ๋ ˆ์ด์–ด๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  Controller๊ฐ€ Game์„ ์ง์ ‘ ์“ธ์ง€

๋ฆฌ๋ทฐ์—๋„ ๋‚จ๊ฒผ๋Š”๋ฐ ์ €๋„ ๋ชจํ˜ธํ•˜๋‹ค๊ณ  ๋А๋ผ๊ณ  ์žˆ์–ด์š”๐Ÿ˜Š ์—๋ด์€ ์ฒ˜์Œ ์„ค๊ณ„ํ• ๋•Œ service blackjackGame์„ ๊ฐ๊ฐ ์–ด๋–ค ์—ญํ• ๋กœ ํ™œ์šฉํ•˜๋ ค๊ณ  service๋ฅผ ์ถ”๊ฐ€ํ–ˆ์—ˆ์„๊นŒ์š”?

}

private boolean hasDuplicatedName(List<String> playerNames) {
return playerNames.size() != playerNames.stream().distinct().count();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ค‘๋ณต ํ™•์ธ์„ ์œ„ํ•ด ์ž๋ฃŒ๊ตฌ์กฐ๋ฅผ ํ™œ์šฉํ•ด๋ณด๋ฉด ์–ด๋–จ๊นŒ์š”?

Comment on lines 20 to 22
final List<Player> players = playerNames.stream()
.map(Player::new)
.toList();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

player๊ฐ์ฒด ์ƒ์„ฑ ์ฑ…์ž„์„ BlackjacService๋ณด๋‹ค Players์—๊ฒŒ ๋„˜๊ธฐ๋Š”๊ฑด ์–ด๋– ์‹ค๊นŒ์š”?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋”œ๋Ÿฌ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ์ ์ ˆํ•œ ๊ณณ์—์„œ ๊ฐ์ฒด ์ƒ์„ฑํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™๋„ค์š”:)

Comment on lines +49 to +56
private int readPlayerBattingMoneyRetry(String playerName) {
int battingMoney = -1;

while (battingMoney <= 0) {
battingMoney = readPlayerBattingMoney(playerName);
}
return battingMoney;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do-while๋ฌธ์„ ํ™œ์šฉํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”? ์ง€๊ธˆ์€ -1์˜ ์˜๋ฏธ๋ฅผ ํ•ด์„ํ•˜๊ธฐ ์–ด๋ ต๋„ค์š”..!

Copy link
Author

@RealTake RealTake Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do-while ๋ฌธ ๋ณด๋‹ค ์ง€๊ธˆ ํ˜•ํƒœ๊ฐ€ ๊ฐ„๋‹จํ•ด ๋ณด์—ฌ์„œ ์ ์šฉํ–ˆ์—ˆ์Šต๋‹ˆ๋‹ค.
๋ง์”€์ฃผ์‹  ๋Œ€๋กœ -1์ด ํ•ด์„ํ•˜๋Š”๋ฐ ๋ถˆํŽธํ•จ์„ ์ฃผ๋Š”๊ฒƒ ๊ฐ™์•„๋ณด์ž…๋‹ˆ๋‹ค.! ํ”ผ๋“œ๋ฐฑ ์ฃผ์‹ ๋Œ€๋กœ ์ˆ˜์ •ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค

import team.blackjack.view.OutputView;

public class BlackJackController {
private final BlackJackService blackJackService;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์—๋ด์ด ์ƒ๊ฐํ•˜์‹œ๊ธฐ์— blackJackController์™€ blackJackService์˜ ๊ฐ๊ฐ ์—ญํ• ์ด ๋ฌด์—‡์ผ๊นŒ์š”?
ํ˜„์žฌ๋Š” ๋กœ์ง์ด Controller์— ๋” ๋งŽ์€ ๊ฒƒ ๊ฐ™์€๋ฐ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹ค๊นŒ์š”?

OutputView.printAskDrawCard(playerName);
String hitYn = InputView.readHitDecision();

while (!"y".equalsIgnoreCase(hitYn) && !"n".equalsIgnoreCase(hitYn)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"y","n"์ด ๋ฐ˜๋ณต๋˜๋Š” ์ƒ์ˆ˜๋กœ ๊ด€๋ฆฌํ•˜๋Š”๊ฑด ์–ด๋– ์‹ค๊นŒ์š”?

public void drawInitialCards() {
this.players.initPlayerHands(deck);

this.dealer.hit(dealer.draw(deck));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.dealer.hit(dealer.draw(deck));
this.dealer.hit(deck.draw());

์ด๋ ‡๊ฒŒ๋„ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์€๋ฐ dealer.draw()๋ฉ”์„œ๋“œ๋ฅผ ๋งŒ๋“  ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”?

Comment on lines +43 to +49
private double calculateMoney(Player player) {
final Result result = judge(player);
return result.getOdds() * player.getBatMoney();
}

private Result judge(Player player) {
if (player.isBust()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ ์ˆ˜ ๊ณ„์‚ฐ ๋ฐ ํŒ๋‹จํ•˜๋Š” ๋กœ์ง์€ ์ค‘์š”ํ•œ ๋กœ์ง์ธ๋ฐ์š”. ํ…Œ์ŠคํŠธ๊ฐ€ ๊ฐ€๋Šฅํ•œ ๊ตฌ์กฐ๊ฐ€ ์•„๋‹Œ๊ฒƒ ๊ฐ™๋„ค์š”..! ์ ์ ˆํ•œ ๊ฐ์ฒด์—๊ฒŒ ์ฑ…์ž„์„ ๋„˜๊ฒจ๋ณด๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”?


public List<Integer> getScore() {
return this.number.score;
public Set<Integer> getScore() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set์ž๋ฃŒ๊ตฌ์กฐ ํ™œ์šฉ๐Ÿ‘

Comment on lines +12 to +16
public Dealer dealer;
public Player pobi;
public Player jason;
public Players players;
public BlackjackGame game;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public์ผ ํ•„์š”๊ฐ€ ์žˆ์„๊นŒ์š”?

public class Player extends Participant {
private final String name;
private final List<Hand> hands;
private double batMoney;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ทœ์น™ 3: ๋ชจ๋“  ์›์‹œ๊ฐ’๊ณผ ๋ฌธ์ž์—ด์„ ํฌ์žฅํ•œ๋‹ค.

๋ฐฐํŒ…๊ธˆ์•ก์ด ์Œ์ˆ˜๊ฐ€ ์•ˆ๋˜๋„๋ก view์—์„œ ์ž˜ ๋ง‰์œผ์…จ์–ด์š”..!๐Ÿ‘
๋‹ค๋งŒ, ๋ฐฐํŒ… ๊ธˆ์•ก์ด ์Œ์ˆ˜๊ฐ€ ์•ˆ๋˜๋Š”๊ฑด ๋„๋ฉ”์ธ ๊ทœ์น™์— ํ•ด๋‹น๋œ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š”๋ฐ ๋„๋ฉ”์ธ์—์„œ๋„ ๊ฒ€์ฆํ•˜๋Š”๊ฑด ์–ด๋– ์‹ค๊นŒ์š”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants